<?php
/* SVN FILE: $Id: adminSettings.php 256 2010-01-05 01:09:10Z supersmashbrothers $ */
/**
* ibMarket 2
* IP.Board 3.0
* ibMarket Bank Settings
*
* @author $Author: supersmashbrothers $
* @copyright $Copyright$
* @version $Revision: 256 $
* @lastrevision $Date: 2010-01-05 01:09:10 +0000 (Tue, 05 Jan 2010) $
* @modifiedby $LastChangedBy: supersmashbrothers $
* @lastmodified $LastChangedDate: 2010-01-05 01:09:10 +0000 (Tue, 05 Jan 2010) $
* @filesource $URL: http://ipb-ibmarket.googlecode.com/svn/ibmarket2/trunk/admin/applications_addon/other/ibmarket/plugins/bank/adminSettings.php $
*/

class admin_settings__bank extends admin_settings
{
	/**
	 * The settings form a person see
	 *
	 * @access	public
	 * @return	string	The settings HTML
	 */
	public function settingsForm(array $pluginInfo)
	{
		$this->registry->getClass('class_localization')->loadLanguageFile( array( 'bank_bank' ) );
		
		$settings = unserialize($pluginInfo['plugin_config']);
		$settings['max_account'] = isset($settings['max_account']) ? $settings['max_account'] : 0;
		$max = ipsRegistry::getClass('output')->formSimpleInput('max_account', $settings['max_account']);
		return <<<EOF
			<li>
				<label>
					{$this->lang->words['setting_max_accounts']}
					<span class="desctext">{$this->lang->words['setting_max_accounts_desc']}</span>
				</label>
				{$max}
			</li>

EOF;
	}
	
	/**
	 * Saving the settings to a plugin
	 *
	 * @access	public
	 * @return	void
	 */
	public function settingsSave(array &$pluginInfo)
	{
		$setting = array();
		$setting['max_account'] = max(intval($this->request['max_account']),0);
		
		$pluginInfo['plugin_config'] = serialize($setting);
	}
}